package aybolit.core.objects.model;

import javax.persistence.Entity;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * Created by IntelliJ IDEA.
 * User: Vadim
 * Date: 29.03.13
 * Time: 16:54
 * To change this template use File | Settings | File Templates.
 */
@javax.persistence.Table(name = "healing_doctors", schema = "", catalog = "aybolit")
@Entity
public class HealingDoctors implements Serializable {
    private int healingDoctorId;

    @javax.persistence.Column(name = "healing_doctor_id")
    @javax.persistence.Id
    public int getHealingDoctorId() {
        return healingDoctorId;
    }

    public void setHealingDoctorId(int healingDoctorId) {
        this.healingDoctorId = healingDoctorId;
    }

    private int patientId;

    @javax.persistence.Column(name = "patient_id")
    @javax.persistence.Basic
    public int getPatientId() {
        return patientId;
    }

    public void setPatientId(int patientId) {
        this.patientId = patientId;
    }

    private int operId;

    @javax.persistence.Column(name = "oper_id")
    @javax.persistence.Basic
    public int getOperId() {
        return operId;
    }

    public void setOperId(int operId) {
        this.operId = operId;
    }

    private int operTypeId;

    @javax.persistence.Column(name = "oper_type_id")
    @javax.persistence.Basic
    public int getOperTypeId() {
        return operTypeId;
    }

    public void setOperTypeId(int operTypeId) {
        this.operTypeId = operTypeId;
    }

    private Timestamp timestamp;

    @javax.persistence.Column(name = "timestamp_")
    @javax.persistence.Basic
    public Timestamp getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Timestamp timestamp) {
        this.timestamp = timestamp;
    }

    private int deleted;

    @javax.persistence.Column(name = "deleted")
    @javax.persistence.Basic
    public int getDeleted() {
        return deleted;
    }

    public void setDeleted(int deleted) {
        this.deleted = deleted;
    }

    private int healingId;

    @javax.persistence.Column(name = "healing_id")
    @javax.persistence.Basic
    public int getHealingId() {
        return healingId;
    }

    public void setHealingId(int healingId) {
        this.healingId = healingId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        HealingDoctors that = (HealingDoctors) o;

        if (deleted != that.deleted) return false;
        if (healingDoctorId != that.healingDoctorId) return false;
        if (healingId != that.healingId) return false;
        if (operId != that.operId) return false;
        if (operTypeId != that.operTypeId) return false;
        if (patientId != that.patientId) return false;
        if (timestamp != null ? !timestamp.equals(that.timestamp) : that.timestamp != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = healingDoctorId;
        result = 31 * result + patientId;
        result = 31 * result + operId;
        result = 31 * result + operTypeId;
        result = 31 * result + (timestamp != null ? timestamp.hashCode() : 0);
        result = 31 * result + deleted;
        result = 31 * result + healingId;
        return result;
    }

    private Healing healingByHealingId;

    @javax.persistence.ManyToOne
    public
    @javax.persistence.JoinColumn(name = "healing_id", referencedColumnName = "healing_id")
    Healing getHealingByHealingId() {
        return healingByHealingId;
    }

    public void setHealingByHealingId(Healing healingByHealingId) {
        this.healingByHealingId = healingByHealingId;
    }

    private Operators operatorsByOperId;

    @javax.persistence.ManyToOne
    public
    @javax.persistence.JoinColumn(name = "oper_id", referencedColumnName = "oper_id")
    Operators getOperatorsByOperId() {
        return operatorsByOperId;
    }

    public void setOperatorsByOperId(Operators operatorsByOperId) {
        this.operatorsByOperId = operatorsByOperId;
    }

    private OperTypes operTypesByOperTypeId;

    @javax.persistence.ManyToOne
    public
    @javax.persistence.JoinColumn(name = "oper_type_id", referencedColumnName = "oper_type_id")
    OperTypes getOperTypesByOperTypeId() {
        return operTypesByOperTypeId;
    }

    public void setOperTypesByOperTypeId(OperTypes operTypesByOperTypeId) {
        this.operTypesByOperTypeId = operTypesByOperTypeId;
    }

    private Patientes patientesByPatientId;

    @javax.persistence.ManyToOne
    public
    @javax.persistence.JoinColumn(name = "patient_id", referencedColumnName = "patient_id")
    Patientes getPatientesByPatientId() {
        return patientesByPatientId;
    }

    public void setPatientesByPatientId(Patientes patientesByPatientId) {
        this.patientesByPatientId = patientesByPatientId;
    }
}
